#include <54func.h>
int main(int argc,char *argv[])
{
    // ./9_fork_share file
    ARGS_CHECK(argc,2);
    //先open->fork
    int fd = open(argv[1],O_RDWR);
    ERROR_CHECK(fd,-1,"open");

    if(fork())
    {
        sleep(2);
        write(fd,"World!",6);
    }else{
        write(fd,"Hello",5);
    }
    return 0;

    //总结：先open，在fork，那么创建的子进程与父进程是共享同一块文件对象
}
